<div ng-if="pagedata.showad">
<div class="popup" ng-init="pagedata.openad()">
	<div class="popup-body">
		<div class="popup-bottom" style="height:100%;background:#333">
		<div class="fe-floatico" id="wait_sq" style="position: absolute;right:0.5rem;top:0.2rem;width:auto;height:1rem;color: #ddd;font-size:0.65rem;z-index:10008">
			请先播放视频
		</div>
			<div style="padding:1rem 0.5rem">
				<div id="containerId"></div>
			</div>
		</div>
	</div>
</div>
<script>
scope.pagedata.upad_log=function(){
   //scope.post_json('jy_aixiaoyi/index/upad_log/',{},function(res){
	//	scope.$evalAsync();
  // });
}
scope.pagedata.duration=5;
if(scope.pagedata.duration && scope.pagedata.showad){
	scope.count_down(parseInt(scope.pagedata.duration),'wait_sq','秒后跳过动画>>',function(){
			scope.pagedata.showad=false;
			scope.pagedata.showtype=false;
			scope.pagedata.upad_log();
			scope.$evalAsync();
	});
}
</script>
<script type="text/javascript">
scope.pagedata.openad=function(){
	// H5 SDK 在线文档地址：http://developers.adnet.qq.com/doc/web/js_develop
	// 全局命名空间申明TencentGDT对象
	window.TencentGDT = window.TencentGDT || [];	
	// 广告初始化
	if(scope.pagedata.pluginset.ad_id2 && scope.pagedata.pluginset.ad_appid) {
        window.TencentGDT.push({
            app_id: scope.pagedata.pluginset.ad_appid, // {String} - appid - 必填
            placement_id: scope.pagedata.pluginset.ad_id2, // {String} - 广告位id - 必填
            type: 'rewardVideo', // {String} - 原生广告类型 - 必填
            count: 1, // {Number} - 拉取广告的数量，默认是3，最高支持10 - 选填
            onComplete: function (res) {
                console.log('TencentGDT');
				if(res.code == 0) {
                        // 激励视频实例化，初始化完成后，可在任意地方进行实例化操作
                        var video = new TencentGDT.NATIVE.rewardVideoAd( function(res) {
                            // 激励视频回调参数
                            console.log(res);
                        });
                        // 激励视频加载方法
                        video.loadAd();
                        // 激励视频播放方法
                        video.showAd();
                        scope.pagedata.upad_log();
                 }else{
                        scope.message('广告播放失败，失败信息：'+res.msg,'error');
                }
            }
        });
        // H5 SDK接入全局只需运行一次
        (function () {
            var doc = document,
                h = doc.getElementsByTagName('head')[0],
                s = doc.createElement('script');
            s.async = true;
            s.src = '//qzs.gdtimg.com/union/res/union_sdk/page/h5_sdk/i.js';
            h && h.insertBefore(s, h.firstChild);
        })();
    }
}
</script>
</div>